Skip to content

Conversation

@zoontek
Copy link
Contributor

@zoontek zoontek commented Jul 22, 2024

Let's suppose you have this router:

export const Router = createRouter({
  Home: "/",
  ProjectRoot: "/projects/:projectId",

  DevelopersApi:
    "/projects/:projectId/:projectEnv{live|sandbox}/developers/api",
});

const doSomething = (name: "ProjectRoot" | "DevelopersApi") => {
  Router.push(name, { projectId: "" }); // no error before, now there's one
};

Before, there was no error. The route name could be either ProjectRoot or DevelopersApi, but the params was not an intersection or both those route params.

@zoontek zoontek requested review from bloodyowl and sandrine-ds July 22, 2024 13:31
@zoontek zoontek merged commit f334dfd into main Jul 22, 2024
@zoontek zoontek deleted the fix-route-union-params branch July 22, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants